<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<ui:composition template="../_template.xhtml">
	<ui:define name="title">
		Pesquisa de Internet - Ctrl.Liberty
	</ui:define>
	
	<ui:define name="content">
		<h:form>
			<h2>Pesquisa de Internet</h2>
			
		<div id="divPesquisa" style="padding-bottom:10px">
								
				<p:fieldset legend="Filtros da Pesquisa">
					<div style="float:left">
						<h:panelGrid columns="3">
							<h:panelGroup>
								<h:outputLabel value="Telefone Principal" >*:</h:outputLabel>
								<h:selectOneMenu value="#{pesqNet.idTelefone}" style="width:145px">
									<f:selectItems var="tel" itemValue="#{tel.id}" itemLabel="#{tel.numero}" value="#{pesqNet.listaTelefone}" />
								</h:selectOneMenu>		
							</h:panelGroup>

							<h:panelGroup>
								<h:outputLabel value="Data Inicial">*:</h:outputLabel>
								<p:calendar value="#{pesqNet.campos.dataInicial}">
									<f:converter converterId="dateConverter"/>
								</p:calendar>
							</h:panelGroup>
							
							<h:panelGroup>
								<h:outputLabel value="Data Final">*:</h:outputLabel>
								<p:calendar value="#{pesqNet.campos.dataFinal}">
									<f:converter converterId="dateConverter"/>
								</p:calendar>
							</h:panelGroup>
							
						</h:panelGrid>
					</div>
					
					<div style="float:right; margin-top:40px;">
						<h:commandButton action="#{pesqNet.pesquisarInternet}" value="Pesquisar" />
					</div>
					
				</p:fieldset>			
			</div>
					
			<div id="resultadoPesquisa">
				<p:fieldset legend="Resultado da Pesquisa" rendered="#{not empty pesqNet.listaInternet}">
					<p:dataTable var="internet" value="#{pesqNet.listaInternet}" paginator="true" rows="10"
						paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
						rowsPerPageTemplate="10">
	
						<f:facet name="header">Uso da Internet Mobile</f:facet>
	
						<p:column>
							<f:facet name="header">
								<h:outputText value="Endereço (URL)" />
							</f:facet>
							<h:outputText value="#{internet.url}" />
						</p:column>
	
						<p:column>
							<f:facet name="header">Nome do Site</f:facet>
							<h:outputText value="#{internet.nomeSite}" />
						</p:column>
						
						<p:column>
							<f:facet name="header">Quantidade de Dados</f:facet>
							<h:outputText value="#{internet.qtdDados}" />
						</p:column>
						
						<p:column>
							<f:facet name="header">Data</f:facet>
							<h:outputText value="#{internet.dataAcesso}" >
								<f:convertDateTime pattern="dd/MM/yyyy - HH:mm:ss"/>
							</h:outputText>
						</p:column>
	
	
					</p:dataTable>
				</p:fieldset>
			
				
			</div>

			</h:form>


		</ui:define>

	<ui:define name="footer">
	    Add your footer here or delete to use the default
	</ui:define>

	</ui:composition>
</html>